using System;
using System.Runtime.Serialization;
using System.Security;
namespace Net35.Xrm.Sdk
{
	[Serializable]
	public sealed class InvalidPluginExecutionException : Exception, ISerializable
	{
		private OperationStatus _status;
		public OperationStatus Status
		{
			get
			{
				return this._status;
			}
		}
		public int ErrorCode
		{
			get
			{
				return base.HResult;
			}
		}
		public InvalidPluginExecutionException()
		{
			this._status = OperationStatus.Failed;
		}
		public InvalidPluginExecutionException(OperationStatus status) : this(status, string.Empty)
		{
		}
		public InvalidPluginExecutionException(string message) : base(message)
		{
			this._status = OperationStatus.Failed;
		}
		public InvalidPluginExecutionException(OperationStatus status, string message) : this(status, 0, message)
		{
		}
		public InvalidPluginExecutionException(string message, Exception exception) : base(message, exception)
		{
			this._status = OperationStatus.Failed;
		}
		public InvalidPluginExecutionException(OperationStatus status, int errorCode, string message) : this(message)
		{
			this._status = status;
			if (errorCode != 0)
			{
				base.HResult = errorCode;
			}
		}
		private InvalidPluginExecutionException(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			this._status = (OperationStatus)info.GetValue("Status", typeof(OperationStatus));
		}
		[SecurityCritical]
		public override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			if (info == null)
			{
				throw new ArgumentNullException("info");
			}
			info.AddValue("Status", this._status, typeof(OperationStatus));
			base.GetObjectData(info, context);
		}
	}
}
